home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-25 | 2.8 KB | 127 lines | [TEXT/CWIE] |
- // ==================================================
- // UFileTools.h
- // Copyright (C) 1994-1997 Mizutori Tetsuya
- // March 5, 1997
- // ==================================================
- // All documents are pretty-printed in 10-point Geneva font.
-
- #pragma once
-
- #include <StandardFile.h>
-
-
- typedef enum {
- fileType_Volume = 1,
- fileType_Folder,
- fileType_File,
- fileType_Unknown,
- fileType_END
- } EFileType;
-
-
- class UFileTools {
-
- public:
- UFileTools();
- ~UFileTools();
-
- public:
-
- // Get the creation/modification date time of the given FSSpec
- static OSErr GetFSSpecDateTime(
- FSSpec & inFSSpec,
- unsigned long & outCreationDate,
- unsigned long & outModificationDate );
-
- // Set the creation/modification date time of the given FSSpec
- static OSErr SetFSSpecDateTime(
- FSSpec & inFSSpec,
- unsigned long inCreationDate,
- unsigned long inModificationDate );
-
- private:
-
- static OSErr GetFileDateTime(
- FSSpec & inFSSpec,
- unsigned long & outCreationDate,
- unsigned long & outModificationDate );
-
- static OSErr SetFileDateTime(
- FSSpec & inFSSpec,
- unsigned long inCreationDate,
- unsigned long inModificationDate );
-
- static OSErr GetFolderDateTime(
- FSSpec & inFSSpec,
- unsigned long & outCreationDate,
- unsigned long & outModificationDate );
-
- static OSErr SetFolderDateTime(
- FSSpec & inFSSpec,
- unsigned long inCreationDate,
- unsigned long inModificationDate );
-
- public:
-
- // Update the finder's folder status
- static OSErr TouchDir(
- short inVRefNum,
- long inDirID );
-
- // Test the file type of a particular file
- static EFileType GetFSSpecType(
- FSSpec & inFSSpec );
-
- static OSErr QueryFile(
- FSSpec & inFSSpec,
- EFileType & outFileType,
- long & outFileID );
-
- // Search a particure directory for the files in it.
- static OSErr SearchDirectory(
- long inIndex, // begins with one.
- FSSpec & inDirSpec,
- FSSpec & outFSSpec,
- EFileType & outFileType );
-
- static OSErr SearchDirectory(
- long inIndex, // begins with one.
- short inVRefNum,
- long inDirID,
- FSSpec & outFSSpec,
- EFileType & outFileType );
-
- // Get the full pathname of a particular file.
- static OSErr GetFullPathname(
- const FSSpec & inFSSpec,
- Str255 outPathname,
- Boolean inAddFilename = false );
-
- // Get the file spec of the current application process.
- static OSErr GetCurrentApplicationFile(
- FSSpec & outFSSpec );
-
- public:
-
- static void PStrCopy(
- Str255 dstP,
- const Str255 srcP );
-
- static void PStrCopy(
- Str255 dstP,
- const unsigned char * srcP,
- const long length );
-
- static void PStrAppend(
- Str255 dstP,
- const Str255 srcP );
-
- static void PStrAppend(
- Str255 dstP,
- const unsigned char * srcP,
- const long length );
-
- };
-
- // end of definitions
-